package com.wn.es.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "student_index",shards = 1,replicas = 1)
public class Student {
 
    @Id
    private String id;

    // 表示字符串类型有：keyword和text，区别是：keyword不会分词，text会分词
    @Field(type = FieldType.Keyword)
    private String name;
 
    @Field(type = FieldType.Text,analyzer = "ik_smart")
    private String desc;
 
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String data;
 
    @Field(type = FieldType.Integer)
    private Integer age;
}